﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Threading;
using System.IO;
using MikroObject;

namespace Aktarim
{
    static class Program
    {

        public static DevExpress.LookAndFeel.DefaultLookAndFeel look = new DevExpress.LookAndFeel.DefaultLookAndFeel();

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {

            bool acik;
            Mutex Mtx = new Mutex(true, "Aktarim", out acik);
            if (!acik)
            {
                MessageBox.Show("Bu program, zaten Çalışıyor.");
                return;
            }
            GC.KeepAlive(Mtx);

            look.LookAndFeel.SkinName = "Black";
            DevExpress.Skins.SkinManager.EnableFormSkins();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Config.GetConfig.Path = Application.StartupPath;
            Logging.GetLog.LogFile = Application.StartupPath + "\\Hata.txt";

            if (!File.Exists(Application.StartupPath + "\\Ayarlar.ini"))
            {
                frmAyarlar ayar = new frmAyarlar();
                if (ayar.ShowDialog() == DialogResult.OK)
                {
                    Config.GetConfig.Save();
                    Application.Exit();
                }
            }
            else
            {
                Config.GetConfig.Load();
                Application.Run(new frmMain());
            }
        }
    }
}
